﻿using System.Data;
using System.Data.SqlClient;

/// <summary>
/// Summary description for SqlParameterEx
/// </summary>
public class SqlParameterEx
{
    public static SqlParameter CreateParameter(string name, SqlDbType type, object value)
    {
        return CreateParameter(name, type, 0, value);
    }

    public static SqlParameter CreateParameter(string name, SqlDbType type, int size, object value)
    {
        SqlParameter parameter = new SqlParameter(name, type);
        if (size > 0)
            parameter.Size = size;
        parameter.Value = value;
        return parameter;
    }
}